package com.sen.design.pattern.structural.decorator.v2;

/**
 * 装饰者模式：在不改变原有对象的基础上，将功能附加到对象上；提供了比继承更有弹性的替代方案（扩展原有对象的功能）
 */
public class Test {

    public static void main(String[] args) {
        ABattercake battercake = new Battercake();
        battercake = new EggDecorator(battercake);
        battercake = new EggDecorator(battercake);
        battercake = new SausageDecorator(battercake);
        System.out.println(battercake.getDesc() + " 销售价格：" + battercake.cost());
    }
}
